import * as s from '@/components/utils/sessionStorage'
const global = {
  state: {
    isCollapse: false,
    flagShow: s.get('flagShow') || false,
  },
  mutations: {
    setIsCollapse: (state, payload) => {
      state.isCollapse = payload
    },
    setFlagShow: (state, flag) => {
      state.flagShow = s.get('flagShow') || false
    }
  },
  actions: {
    setFlagShow: ({ commit, dispatch, state }, payload)=> {
      s.set('flagShow', payload)
      commit('setFlagShow')
    }
  }
}

export default global
